
package com.work.jaxb.menu;

import java.io.Serializable;
import java.util.List;

import javax.xml.bind.annotation.*;

import org.apache.commons.lang3.builder.*;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "option", propOrder = {"properties", "options"})
public class XmlOption implements Serializable {

	private static final long serialVersionUID = -9142931032154060341L;

	@XmlAttribute(required = true, name = "id")
	private String id;

	@XmlElement(required = true, name = "property")
	@XmlElementWrapper(required = true, name = "properties")
	List<XmlOptionProperty> properties;

	@XmlElement(required = true, name = "option")
	@XmlElementWrapper(required = false, name = "options")
	List<XmlOption> options;

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public List<XmlOption> getOptions()
	{
		return options;
	}

	public void setOptions(List<XmlOption> options)
	{
		this.options = options;
	}

	public List<XmlOptionProperty> getProperties()
	{
		return properties;
	}

	public void setProperties(List<XmlOptionProperty> properties)
	{
		this.properties = properties;
	}
	
	public String toString()
	{
		return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()).toString();
	}

}
